import { Rule } from "./types";

export const PylintRefactorRuleList: Rule[] = [
    {
        code: "PLR0133",
        name: "comparison-of-constant",
        descEn: "Two constants compared in a comparison, consider replacing {left_constant} {op} {right_constant}",
        descCn: "",
        autoFix: false,
    },
    {
        code: "PLR0206",
        name: "property-with-parameters",
        descEn: "Cannot have defined parameters for properties",
        descCn: "",
        autoFix: false,
    },
    {
        code: "PLR0402",
        name: "manual-from-import",
        descEn: "Use from {module} import {name} in lieu of alias",
        descCn: "",
        autoFix: true,
    },
    {
        code: "PLR0911",
        name: "too-many-return-statements",
        descEn: "Too many return statements ({returns} > {max_returns})",
        descCn: "",
        autoFix: false,
    },
    {
        code: "PLR0912",
        name: "too-many-branches",
        descEn: "Too many branches ({branches} > {max_branches})",
        descCn: "",
        autoFix: false,
    },
    {
        code: "PLR0913",
        name: "too-many-arguments",
        descEn: "Too many arguments to function call ({c_args} > {max_args})",
        descCn: "",
        autoFix: false,
    },
    {
        code: "PLR0915",
        name: "too-many-statements",
        descEn: "Too many statements ({statements} > {max_statements})",
        descCn: "",
        autoFix: false,
    },
    {
        code: "PLR1701",
        name: "repeated-isinstance-calls",
        descEn: "Merge these isinstance calls: isinstance({obj}, ({types}))	",
        descCn: "",
        autoFix: false,
    },
    {
        code: "PLR1711",
        name: "useless-return",
        descEn: "Useless return statement at end of function",
        descCn: "",
        autoFix: true,
    },
    {
        code: "PLR1722",
        name: "sys-exit-alias",
        descEn: "Use sys.exit() instead of {name}",
        descCn: "",
        autoFix: true,
    },
    {
        code: "PLR2004",
        name: "magic-value-comparison",
        descEn: "Magic value used in comparison, consider replacing {value} with a constant variable",
        descCn: "",
        autoFix: false,
    },
    {
        code: "PLR5501",
        name: "collapsible-else-if",
        descEn: "Consider using elif instead of else then if to remove one indentation level",
        descCn: "",
        autoFix: false,
    },
];